#ifndef SLEEFSVIEW_H
#define SLEEFSVIEW_H

#include <QTableView>
#include <QDir>
#include <QString>

class SleeFSView : public QTableView
{
    Q_OBJECT
    bool m_is_active;


private:
    void current_item_to_sel();
public:
    explicit SleeFSView(QWidget *parent = 0);
    void directory_up();
    void cd(const QDir &dir);

    void set_active(bool state = true);
    bool is_active() const {return m_is_active;}

    QStringList selected_paths() const;
    QString root_path() const;

protected:
    virtual void keyPressEvent(QKeyEvent *event);
    virtual void resizeEvent(QResizeEvent *event);
    virtual void focusInEvent(QFocusEvent *event);
    virtual void focusOutEvent(QFocusEvent *event);
    virtual void paintEvent(QPaintEvent *e);
signals:

    void enter_pressed(QModelIndex index);
    void tab_pressed(QModelIndex index);
    void got_focus();

public slots:

    void update_view();
};

#endif // SLEEFSVIEW_H
